"""
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    created by siyi.chen on '10/01/2025'
    comment: coze相关模型
"""
from sqlalchemy import func
from sqlalchemy.dialects.mysql import DATETIME, TIMESTAMP,INTEGER
from project import CustomModel
from project.core.base import Column, CustomDict


class CozeTemp(CustomModel):
    """ coze 临时数据表
    """
    __tablename__ = "coze_temp"
    id = Column(INTEGER(unsigned=True), primary_key=True, autoincrement=True)
    effective_days = Column(INTEGER(unsigned=True), nullable=False, server_default='', comment='有效天数')
    data = Column(CustomDict, nullable=False, server_default='', comment='源数据')
    create_time = Column(DATETIME, nullable=False, server_default=func.now(), is_displayed=False)
    update_time = Column(TIMESTAMP, nullable=False, server_default=func.now(), onupdate=func.now(), is_displayed=False)
